﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UCF.Core
{
    /// <summary>
    /// 日志帮助类
    /// </summary>
    /// <remarks>2014-6-5 by sutroon</remarks>
    public class LogHelper
    {
        public static bool IsDebug { get; set; }
        public static bool IsInfo { get; set; }
        public static bool IsError { get; set; }
        public static bool IsLog { get; set; }
        public static Action<string> LogHandler { get; set; }
        public static void Debug(string msg, params object[] args)
        {
            if (IsDebug && LogHandler != null) LogHandler(string.Format(msg, args));
        }
        public static void Info(string msg, params object[] args)
        {
            if (IsInfo && LogHandler != null) LogHandler(string.Format(msg, args));
        }
        public static void Error(string msg, params object[] args)
        {
            if (IsError && LogHandler != null) LogHandler(string.Format(msg, args));
        }
        public static void Log(string msg, params object[] args)
        {
            if (IsLog && LogHandler != null) LogHandler(string.Format(msg, args));
        }
    }
}
